package com.woniu.common;

public class JsonResult {
    private String msg;
    private Integer code;
    private Object result;

    public JsonResult() {
    }

    public JsonResult(String msg, Integer code, Object result) {
        this.msg = msg;
        this.code = code;
        this.result = result;
    }

    public JsonResult(String msg, Integer code) {
        this.msg = msg;
        this.code = code;
    }

    public JsonResult(String msg) {
        this.msg = msg;
    }

    public JsonResult(Integer code) {
        this.code = code;
    }

    public static JsonResult ok(String msg){
        return new JsonResult(200);
    }
    public static JsonResult ok(){
        return new JsonResult(200);
    }
    public static JsonResult erro(){
        return new JsonResult(500);
    }
    public static JsonResult erro(String msg){
        return new JsonResult(500);
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
